const userData = [
  {
    id: 0,
    user: "admin0@163.com",
    pwd: "123456",
    name: "八组0",
  },
  {
    id: 1,
    user: "admin1@163.com",
    pwd: "123456",
    name: "八组1",
  },
  {
    id: 2,
    user: "admin2@163.com",
    pwd: "123456",
    name: "八组2",
  },
]

$("#btn-login").on("click", function () {
  const user = $("#inputEmail3").val()
  const pwd = $("#inputPassword3").val()
  userData.forEach((ele, index) => {
    if (ele.user == user && ele.pwd == pwd) {
      window.location.href = "../../index.html"
      const userObj = JSON.stringify(ele)
      localStorage.setItem("user", userObj)
    }
  })
})
